#ifndef COMMAND_PATTERN_H
#define COMMAND_PATTERN_H

#include <string>
#include <list>

using namespace std;

class Order
{
public:
    virtual void execute() = 0;
};

class Stock
{
public:
    ~Stock() {}

    void buy();
    void sell();

private:
    string name = "ABC";
    int quantity = 10;
};

class BuyStock : public Order
{
public:
    BuyStock(Stock* abcStock);
    ~BuyStock();

    void execute() override;

private:
    Stock* abcStock;
};

class SellStock : public Order
{
public:
    SellStock(Stock* abcStock);
    ~SellStock();

    void execute() override;

private:
    Stock* abcStock;
};

class Broker
{
public:
    ~Broker();

    void takeOrder(Order* order);
    void placeOrders();

private:
    list<Order*> orderList;
};

#endif // COMMAND_PATTERN_H

/*
    Stock* abcStock = new Stock();

    BuyStock* buyStockOrder = new BuyStock(abcStock);
    SellStock* sellStockOrder = new SellStock(abcStock);

    Broker* broker = new Broker();
    broker->takeOrder(buyStockOrder);
    broker->takeOrder(sellStockOrder);

    broker->placeOrders();
    */
